<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE >
<html>

<head>
    <meta charset="utf-8">
    <title>员工管理-登录-注册</title>
    <!--Mazey's jQuery-->
    <script type="text/javascript" src="static/js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript"
            src="static/bootstrap-3.4.1/js/bootstrap.js"></script>
    <link href="static/bootstrap-3.4.1/css/bootstrap.css" rel="stylesheet">
    <!--让IE使用最新的渲染模式，支持CSS3-->
    <meta http-equiv="X-UA-Compatible" content="IE-edge,chrome=1">
    <!--如果IE版本低于IE9，使浏览器支持HTML5和CSS3-->

    <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>

    <link rel="stylesheet" href="static/css/style.css"/>
</head>

<body>
<div class="container-fluid">
    <div class="row">
        <div class="col-sm-8 col-sm-offset-2 login">
            <!--代码部分-->
            <ul class="nav nav-tabs nav-justified">
                <li class="active" role="presentation"><a href="#login" data-toggle="tab">登录</a></li>
                <li role="presentation"><a href="#signup" data-toggle="tab">注册</a></li>
            </ul>
            <!--标签页内容部分-->
            <div class="tab-content">
                <div class="tab-pane fade in active" id="login" role="tabpanel">
                    <form class="form-horizontal" action="LoginServlet" method="post">
                        <div class="form-group">
                            <!--样式control-label使内容居右-->
                            <label for="username" class="col-sm-2 control-label">帐号：</label>
                            <div class="col-sm-9 has-feedback">
                                <input type="text" class="form-control" name="username"
                                       placeholder="请输入帐号/2-20位/只限数字字母和下划线"/>
                                <span class="glyphicon form-control-feedback" aria-hidden="true"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="password" class="col-sm-2 control-label">密码：</label>
                            <div class="col-sm-9 has-feedback">
                                <input type="password" class="form-control" name="password"
                                       placeholder="请输入密码/6-20位/只限数字字母和下划线"/>
                                <span class="glyphicon form-control-feedback" aria-hidden="true"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">验证码：</label>
                            <div class="col-sm-3 has-feedback">
                                <input type="text" class="form-control" name="code"/>
                                <span class="glyphicon form-control-feedback" aria-hidden="true"></span>
                            </div>

                                <img id="code_img" src="http://localhost:8081/kaptcha.jpg" alt="" style="width: 100px; height: 28px;">

                        </div>
                        <div class="form-group">
                            <div class="col-sm-9 col-sm-offset-2">
                                <!--样式checkbox为input[type='checkbox']指定合适的样式，相应的还有input[type='radio']的样式radio-->
                                <div class="checkbox">
                                    <!--   <label>
                                          <input type="checkbox" /> 记住密码
                                      </label> -->
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-9 col-sm-offset-2">
                                <button type="submit" class="btn btn-primary btn-sm">登录</button>
                                <!-- <a href="#" class="btn btn-link btn-sm">忘记密码？</a> -->
                            </div>
                        </div>
                    </form>
                </div>

                <div class="tab-pane fade" id="signup" role="tabpanel">
                    <form class="form-horizontal" action="RegisterServlet" method="post">
                        <div class="form-group">
                            <!--样式control-label使内容居右-->
                            <label for="username" class="col-sm-2 control-label">帐号：</label>
                            <div class="col-sm-9 has-feedback">
                                <input type="text" class="form-control" name="username"
                                       placeholder="请输入帐号/2-20位/只限数字字母和下划线"/>
                                <span class="glyphicon form-control-feedback" aria-hidden="true"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="password" class="col-sm-2 control-label">密码：</label>
                            <div class="col-sm-9 has-feedback">
                                <input type="password" class="form-control" name="password"
                                       placeholder="请输入密码/6-20位/只限数字字母和下划线"/>
                                <span class="glyphicon form-control-feedback" aria-hidden="true"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="email" class="col-sm-2 control-label">邮箱：</label>
                            <div class="col-sm-9 has-feedback">
                                <input type="email" class="form-control" name="email" placeholder="请输入邮箱"/>
                                <span class="glyphicon form-control-feedback" aria-hidden="true"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-9 col-sm-offset-2">
                                <button type="submit" class="btn btn-primary btn-sm">注册</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>

</html>

<script>
    //给 验 证 码 的 图 片 ， 绑 定 单 击 事 件
    $("#code_img").click(function () {
        console.log(123)
        this.src = "${basePath}kaptcha.jpg?d=" + new Date();
    });
</script>